﻿using Newtonsoft.Json;
using Volo.Abp.DependencyInjection;

namespace Joy.Erp.BasicArchives.Core.UniqueCodes
{
    public class FixedSegment : ISegment, ITransientDependency
    {
        protected FixedSegmentConfigrationObject ConfigrationObject { get; set; }

        public void Init(string configration)
        {
            ConfigrationObject = JsonConvert.DeserializeObject<FixedSegmentConfigrationObject>(configration);
        }

        public string GetCode(IUniqueCode entity)
        {
            return ConfigrationObject.FixedStr;
        }
    }
}
